package com.ruoyi.common.core.web.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import lombok.Data;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @Author: Wuzh
 * @Description:封装分页工具
 * @Date Created in 14:57 2025-03-16
 * @return
 */
@Data
@Accessors(chain = true)
public class TPage<T extends Serializable> implements IPage<T>, Serializable {

    /**
     * 当前数据
     */
    private List<T> records;

    /**
     * 总数
     */
    private long total = 0;

    @Setter
    @TableField(exist = false)
    private Map<String, Object> params;

    /**
     * 当前页数.
     */
    @NotNull(message = "页码数不能为空")
    @Min(value = 1, message = "最小分页为1")
    private Long page = 1L;

    /**
     * 每页记录数.
     */
    @Max(value = 500, message = "每页记录数不能超过范围")
    private Long limit = 10L;


    @Override
    public List<OrderItem> orders() {
        return null;
    }

    @Override
    public List getRecords() {
        return null;
    }

    @Override
    public IPage setRecords(List records) {
        return null;
    }

    @Override
    public long getTotal() {
        return 0;
    }

    @Override
    public IPage setTotal(long total) {
        return null;
    }

    @Override
    public long getSize() {
        return 0;
    }

    @Override
    public IPage setSize(long size) {
        return null;
    }

    @Override
    public long getCurrent() {
        return 0;
    }

    @Override
    public IPage setCurrent(long current) {
        return null;
    }
}
